package com.bgs.eat.memberRecord.mapper;

import com.bgs.eat.config.BaseMapper;
import com.bgs.eat.memberRecord.entity.MemberRecordEntity;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface MemberRecordMapper extends BaseMapper<MemberRecordEntity> {

    @Select("select * from member_record where user_name=#{userName} and member_id=#{memberId} and del_flag=0")
    @Results(
            {
                    @Result(property = "createTime", column = "create_time"),
                    @Result(property = "expirationTime", column = "expiration_time"),
            }
    )
    // 查询用户是否购买过该会员
    List<MemberRecordEntity> selectUserBuyEatMember(@Param("userName")String userName, @Param("memberId")Integer memberId);
}
